package cn.com.demo.tp01.constomer;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

@Component
@RabbitListener(
        bindings = @QueueBinding(
                value = @Queue(value="demo.direct.queue",autoDelete="false"),
                exchange=@Exchange(value="demo.direct",type= ExchangeTypes.DIRECT),
                key="demo.log.info"
        )
)
public class MainConstomer {
    @RabbitHandler
    public void receive(String message){
        System.out.println("DirectConsumer Received:" + message);
    }
}
